package com.itheima.zy;


import java.util.Random;
import java.util.Scanner;

public class Test5 {
    public static void main(String[] args) {
        /*需求:
	    请做一个猜字小游戏。*/
        Random rand = new Random();
        int a = rand.nextInt(100) + 1;
//        for (int i = 0; i < 10; i++) {
//            int x = rand.nextInt(100);
//        }
        System.out.println("请输入一个数据：");
        Scanner sc = new Scanner(System.in);
        while (true){
            int num = sc.nextInt();
            if (num > a) {
                System.out.println("您输入的数字：" + num + "太大了");
            } else if (num < a) {
                System.out.println("您输入的数字：" + num + "太小了");
            } else {
                System.out.println("您输入的数字：" + num + "答对了");
                break;//判断接收输入数据成立，结束语句
            }
        }



    }
}
